import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";

import Return from "./components/return.vue";
import ScrollView from "./base-ui/scroll-view/scroll-view.vue";

import "./assets/style/border.scss";
import "./assets/style/global.scss";
import "./assets/style/reset.scss";

Vue.config.productionTip = false;
// eventBus事件总线
Vue.prototype.$eventBus = new Vue();
// 注册为了全局组件
Vue.component(Return.name, Return);
Vue.component(ScrollView.name, ScrollView);
new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount("#app");

// 识别设备
const userAgent = window.navigator.userAgent;
let device = "PC";
if (userAgent.indexOf("iPhone") >= 0) {
  device = "ios";
} else if (userAgent.indexOf("Android") >= 0) {
  device = "android";
} else if (userAgent.indexOf("iPad") >= 0) {
  device = "ipad";
}

if (device === "android") {
  document.querySelector("head").innerHTML += `
  <style type="text/css">
    .slideOut{
      animation: slideOut 0ms;
    }
  </style>
  `;
}